// Styles shared between the playground and embeds

@import 'package:dart_pad/scss/colors';
@import 'package:dart_pad/scss/variables';

// Flashes
#flash-container > div + div {
  // Adds space between the flashes in the flash container, if more than one is displayed.
  margin-top: 8px;
}

#issues-container > div + div {
  margin-top: 8px;
}

.flash {
  border-radius: 0;
  border: none;
  padding: 12px;
}

.flash-close {
  padding: 6px;
  margin: -12px;
}

#flash-container {
  width: 380px;
  z-index: 10;
  bottom: 40px;
  right: 8px;
  position: fixed;
}

#issues-container {
  width: 380px;
}

.message-container {
  letter-spacing: 0.05em;
  padding-right: 22px;
  max-height: 120px;
  overflow-y: auto;
  font-family: Roboto Light, sans-serif;
  font-weight: 300;
  a {
    font-weight: bold;
  }
}

.info-message {
  font-family: $editor-font;
  font-size: $embed-editor-font-size;
  cursor: default;
  margin-right: 12px;
}

// Enabled features (e.g. null safety)
#feature-message {
  font-family: Roboto;
  font-weight: bolder;
}

#issues-toggle {
  cursor: pointer;

  // Prevent the layout from changing when toggling between show and hide
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

// Issues
#issues {
  padding: 8px;
  overflow-y: auto;
  max-height: 50vh;
}

#issues .issue {
  display: flex;
  flex-direction: row;
  line-height: 20px;
  border-radius: 3px;
  cursor: pointer;
}

.issue + .issue {
  margin-top: 4px;
}

.issue .issuelabel {
  font-family: $editor-font;
  font-size: $embed-editor-font-size;
  display: inline-block;
  border-radius: 3px;
  padding: 2px 5px;
  min-width: 62px;
}

.issue .issuelabel.error {
  color: $issue-error-color;
  border: 1px solid $issue-error-color;
  background-color: transparent;
}

.issue .issuelabel.warning {
  color: $issue-warning-color;
  border: 1px solid $issue-warning-color;
  background-color: transparent;
}

.issue .issuelabel.info {
  color: $issue-info-color;
  border: 1px solid $issue-info-color;
  background-color: transparent;
}

.issue .message {
  padding-left: 5px;
  line-height: 20px;
}

// Keys dialog
.mdc-dialog__surface {
  // Make the dialog a minimum of 400px to best display the keyboard dialog
  min-width: 512px !important;
}

.keys-dialog {
  top: auto !important;
  bottom: 20px;

  dl {
    padding: 0.5em;
  }

  dt {
    float: left;
    clear: left;
  }
  dd {
    text-align: right;
  }
  dd > span {
    font-family: "Helvetica Neue", "Inconsolata", monospace;
    padding: 0 4px;
    font-size: 10pt;
    color: $dark-blue;
    border: 1px solid $dark-blue;
    border-radius: 2px;
    margin: 2px 2px;
    white-space: nowrap;
    display: inline-block;
  }
}

// Custom scrollbars
.custom-scrollbar {
  margin-right: 8px;
}

.custom-scrollbar::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 9px;
  height: 9px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: $scrollbar-color;
}

// Misc
.view-label {
  font-family: $editor-font;
  font-size: $embed-editor-font-size;
  color: $label-color;
  &.absolute {
    position: absolute;
    left: 0;
    top: 0;
    margin-top: 8px;
    margin-left: 8px;
  }
}

// ie support for hidden
html [hidden] {
  display: none !important;
}
